﻿
#include <stdio.h>
void copy_arr(double target1[][5], double source[][5], int c);
void copy_ptr(double* target2, double* source, int c);
int main(void)
{
    double source[3][5] = { {1.1, 2.2, 3.3, 4.4, 5.5},
                           {2.2, 3.3, 4.4, 5.5, 6.6},
                           {3.3, 4.4, 5.5, 6.6, 7.7} };
    double target1[3][5];
    copy_arr(target1, source, 3);
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 5; j++)
            printf("%.1f ", target1[i][j]);
        printf("\n");
    }
    printf("\n");
    getchar();
    return 0;
}
void copy_arr(double target1[][5], double source[][5], int c)
{
    int i;
    for (i = 0; i < c; i++)
        copy_ptr(target1[i], source[i], 5);   
}
void copy_ptr(double* target2, double* source, int c)
{
    int i;
    for (i = 0; i < c; i++)
        *target2++ = *source++;  
}


